Skip to content

gra init && gra manage#31

Merged
derek-globus merged 1 commit intomainfrom
cli-config-management-sc-48273
Feb 26, 2026
Merged

gra init && gra manage#31
derek-globus merged 1 commit intomainfrom
cli-config-management-sc-48273

Conversation

@derek-globus
Copy link
Contributor

@derek-globus derek-globus commented Feb 18, 2026

sc-48273

What?

  • Add config management commands:
    • gra init to create a config, initializing a "gra repository" (file at .globus_registered_api/config.json)
    • gra manage to configure an existing repository (file initialized with gra init)

How?

  • Added dependencies on two new rendering libraries:
    • rich - for easy table rendering
    • prompt_toolkit for extensible input prompting
      • Implemented custom reusable entry points for prompt_selection and prompt_multiselection. This was necessary for some rendering & interaction customizations.

New Module High Level

  • commands/
    • init.py <-- entirety of the gra init command
    • manage/
      • dispatch.py <-- starting point for the gra manage command, responsible for menu navigation
      • roles.py <-- role config management, defines a subcommand menu for dispatch and handles all prompting/rendering of role-based configuration interactions. This does a lot of back and forth with groups/search/auth to render ids into names.
      • targets.py <-- target config management, defines a subcommand menu for dispatch and handles all prompting/rendeirng for target-based configuration interactions (this now includes scopes as well).
  • rendering/
    • prompt/
      • selector.py <-- a reusable prompt_selection function to solicit that a user choose one of a list of options (used throughout the new commands for things like menu listing, target selection, group selection, etc.)
      • multiselector.py <-- a reusable prompt_multiselection function to solicit that a user choose 0 or more options from a supplied list (used for scope selection during target upsertion)

test paths mirror the new src paths

Testing

  • Unit tested custom input functionality independently
  • Added a prompt_patcher fixture for more readable in-line configuration of tests which have a lot of back and forth input prompting from the user
  • Extensive manual testing against.

Base automatically changed from cli-config-sc-47400 to main February 18, 2026 21:24
@derek-globus derek-globus marked this pull request as ready for review February 24, 2026 18:45
@derek-globus derek-globus changed the title Cli config management sc 48273 gra init && gra manage Feb 26, 2026
@derek-globus derek-globus force-pushed the cli-config-management-sc-48273 branch from ec7dfb2 to 1cfaa8e Compare February 26, 2026 23:11
@derek-globus
Copy link
Contributor Author

Manually squashed commits (UI wasn't offering to do it for me, maybe cause of size; maybe cause of

Commands & comparisons used:

git checkout main
git pull 
git checkout -b clean-squash-branch
git merge --squash cli-config-management-sc-48273
git commit ... 
git diff clean-squash-branch..cli-config-management-sc-48273 # Demonstrate no diff
git push origin clean-squash-branch:cli-config-management-sc-48273 --force

@derek-globus derek-globus merged commit abbd4f4 into main Feb 26, 2026
5 checks passed
@derek-globus derek-globus deleted the cli-config-management-sc-48273 branch February 26, 2026 23:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants